<?php
/**
 * Feedback_AdminController
 * 
 * @author
 * @version 
 */
 
class Log_AdminController extends Zen_Controller_Admin
{
	public $columns = array(
                       	array('name'=>'id','index'=>'id','label'=>'ID','width'=>30),
                       	array('name'=>'message','index'=>'message','label'=>'Сообщение'),
                       	array('name'=>'resource','index'=>'resource','label'=>'Ресурс'),
                       	array('name'=>'priorityName','index'=>'priorityName','label'=>'Приоритет'),
                       	array('name'=>'username','index'=>'username','label'=>'Пользователь'),
                       	array('name'=>'timestamp','index'=>'timestamp','label'=>'Время'),
                    );
	
	
    public function indexAction() {
		$this->view->model=new Log_Model_Message();
		$this->view->columns = $this->columns;
		$this->_helper->layout->setLayout('admin');
	}
	
	public function formAction(){
		$params=$this->_getAllParams();
		$model = new Log_Model_Message();
		$select = $model->select()->setWhere("year(`timestamp`)=" . date('Y'));
		$this->_helper->jqgrid(
    		new Log_Model_Message(),
    		$params,
    		$this->columns,
    		new Zend_Form(),
    		$select
    	);
	}
	
}